<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>宜佳佳管理页面</title>
<link rel="Shortcut Icon" href="<%=request.getContextPath() %>/js/yjj_ui1/lloo.jpg" />
</head>
<!-- easyUI -->
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath() %>/js/easyui/themes/icon.css" type="text/css"></link>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath() %>/js/easyui/themes/default/easyui.css" type="text/css"></link>
<!-- bootstrap应导入的文件 -->
<link rel="stylesheet" href="<%=request.getContextPath() %>/js/bootstrap/css/bootstrap.min.css"></link>
<script src="<%=request.getContextPath() %>/js/bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript" src="<%=request.getContextPath() %>/js/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript">
	//加载页面时展示此div
	$(function(){
		$("#${show}").show();
	});
	
	//查看所有老师的简介
	function teacherAll(){
		location.href="getTacherAll";
	}
	
	//开除此老师
	function deleteOneTeacher(tid,tname){
		if(confirm("你确定要开除 "+tname+" 老师吗")){
			$.post(
				"deleteOneTeacher",
				{tid:tid},
				function(){
					alert("开除成功");
					location.href="teacherAll";
				},"text"
			);
		};
	};
	
	//回现一个老师的数据
	function updateOneTeacher(tid){
		location.href="updateOneTeacher?tid="+tid;
	}
	
	//新教师入住页面
	function newTeacher(){
		location.href="newTeacher";
	}
	
	//进入用户设置页面
	function setUser(){
		location.href="setUser";
	}
	
	//踢除一个用户
	function deleteUser(uid,tel){
		if(confirm("你确定要踢除  "+tel+" 用户吗?")){
			$.post(
				"deleteUser",
				{uid:uid},
				function(){
					alert("踢除成功");
					location.href="setUser";
				},"text"
			);
		}
	}
	
	//进入修改用户页面
	function updateUser(uid){
		location.href="updateUser?uid="+uid;
	}
	
	//进入新增 用户界面
	function addUser(){
		location.href="addUser";
	}
	
	//讲师展示界面的分页
	function fen(page){
		location.href="getTacherAll?page="+page;
	}
	
	//用户展示页面的分页
	function fenUser(page){
		location.href="setUser?page="+page;	
	}
</script>
<body>   
<center>
  <div id="cc" class="easyui-layout" style="width:1366px;height:680px;">   
    <div data-options="region:'north',title:'欢迎光临宜佳佳管理系统',split:true" style="height:130px;background-color: #f66">
    	<br/>
    	<marquee scrollamount="3" behavior="alternate"><font color="#ffffff" size="6em" style="font-family: '华文行楷'">欢迎来到宜佳佳管理系统</font></marquee>
    </div>   
    <div data-options="region:'west',title:'管理菜单',split:true" style="width:180px;background-color: #ccffff" >
    <ul class="easyui-tree" data-options="animate:true">
			<li data-options="state:'closed'">
				<span>功能菜单</span>
				<ul>
					<li data-options="state:'closed'">
						<span>教师管理</span>
						<ul>
							<li>
								<span><button class="btn btn-link btn-xs" onclick="teacherAll()">信息展示</button></span>
							</li>
							<li>
								<span><button class="btn btn-link btn-xs" onclick="newTeacher()">新教师入住</button></span>
							</li>
						</ul>
					</li>
					<li data-options="state:'closed'">
						<span>用户管理</span>
						<ul>
							<li>
							<span><button class="btn btn-link btn-xs" onclick="addUser()">新增用户</button></span>
							</li>
							<li>
							<span><button class="btn btn-link btn-xs" onclick="setUser()">用户设置</button></span>
							</li>
						</ul>
					</li>
					<li data-options="state:'closed'">
						<span>订单管理</span>
						<ul>
							<li>订单详情</li>
							<li>用户设置</li>
						</ul>
					</li>
				</ul>
			</li>
		</ul>

    </div>   
    <div data-options="region:'center',title:'功能展示区'" style="padding:5px;background:#eee;background-color: pink;" id="manager">
    	
    	<!-- 所有老师的展示 -->
    	<div style="display: none;" id="allTeacher">
    	<center><table style="width: 900px;border: 3px solid #3071a9;text-align: center;">
      			<tr style="border: 3px solid #3071a9;">
      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">教师编号</td>
      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">教师名片</td>
      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">教师姓名</td>
      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">所讲课程</td>
      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">课程单价</td>
      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">操作</td>
      			</tr>
      			<c:forEach items="${teacherAll}" var="i">
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">${i.tid}<br/></td>
      					<td style="border: 3px solid #3071a9;">
      						<img alt="哎呀,怎么无图片了" src="<%=request.getContextPath() %>/yjj_js/${i.jpgfile}" style="width: 180px;height: 120px">
      					</td>
      					<td style="border: 3px solid #3071a9">${i.tname}导师</td>
      					<td style="border: 3px solid #3071a9">${i.xuename}</td>
      					<td style="border: 3px solid #3071a9">${i.price}¥</td>
      					<td style="border: 3px solid #3071a9"><button class="btn btn-link" onclick="updateOneTeacher(${i.tid})">修改信息</button>/<button class="btn btn-link" onclick="deleteOneTeacher(${i.tid},'${i.tname}')">开除</button></td>
      				</tr>
      			</c:forEach>
      			<tr>
      				<td colspan="11">
      					<button class="btn btn-info" onclick="fen(1)">首页</button>&nbsp;&nbsp;&nbsp;
      					<button class="btn btn-warning" onclick="fen(${p.uppage})">上一页</button>&nbsp;&nbsp;&nbsp;
      					当前页:${p.countpage}/${p.lastpage}&nbsp;&nbsp;&nbsp;
      					<button class="btn btn-danger" onclick="fen(${p.nextpage})">下一页</button>&nbsp;&nbsp;&nbsp;
      					<button class="btn btn-success" onclick="fen(${p.lastpage})">末页</button>
      				</td>
      			</tr>
      		</table></center>
      		</div>
      		
      		<!-- 修改一个老师的信息 -->
      		<div style="display: none;text-align: center;text-align: center;padding-left: 90px;padding-top: 15px" id="updateOneTeacher">
      			<form action="doupdateTeacher" method="post" enctype="multipart/form-data">
      			<table style="text-align: center;border: 3px solid #3071a9">
      				<tr style="border: 3px solid #3071a9;">
      					<td style="border: 3px solid #3071a9;width: 130px">教师名片</td>
      					<td style="border: 3px solid #3071a9;padding-top: 15px">
      						<img alt="哎呀,竟然没有图片了" src="<%=request.getContextPath() %>/yjj_js/${OneTeacher.jpgfile}" style="width: 180px;height: 120px">
      						<input type="hidden" value="${OneTeacher.tid}" name="tid"/>
      						<input type="file" name="filename" style="padding-left: 600px;position: relative;bottom: 25px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">课程价格</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="price" value="${OneTeacher.price}" required="required" style="width: 230px"/>(¥)
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">导师的名字</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="tname"  value="${OneTeacher.tname}" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">课程的名称</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="xuename" value="${OneTeacher.xuename}" required="required"  style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">教材的版本</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="jiaotype" value="${OneTeacher.jiaotype}" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">开课日期</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="stratdate" value="${OneTeacher.stratdate}" onclick="WdatePicker()" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">结课日期</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="enddate" value="${OneTeacher.enddate}"  onclick="WdatePicker()" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">导师的评分</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="grade" value="${OneTeacher.grade}" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">课程的信息</td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="coursetext">${OneTeacher.coursetext}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">课程详情 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="coursecontent">${OneTeacher.coursecontent}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">课程安排 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="courseplan">${OneTeacher.courseplan}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">大纲 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="outline" >${OneTeacher.outline}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">招生名额 </td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="count" value="${OneTeacher.count}" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">教师简介 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="teachermessage">${OneTeacher.teachermessage}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">教学经历 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="experience">${OneTeacher.experience}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">教学成果 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="result">${OneTeacher.result}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;">
      					<td style="border: 3px solid #3071a9">教学风采 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="mien">${OneTeacher.mien}</textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 90px">
      					<td style="border: 3px solid #3071a9">操作 </td>
      					<td style="border: 3px solid #3071a9">
      						<input type="submit" value="保存" class="btn btn-warning"/>
      					</td>
      				</tr>
      			</table>
      			</form>
      		</div>
      		
      		
      		<!-- 新入住老师页面 -->
      		<div style="display: none;text-align: center;text-align: center;padding-left: 90px;padding-top: 15px" id="newTeacher">
      			<form action="doaddTeacher" method="post" enctype="multipart/form-data">
      			<table style="text-align: center;border: 3px solid #3071a9">
      				<tr style="border: 3px solid #3071a9;">
      					<td style="border: 3px solid #3071a9;width: 130px">教师名片</td>
      					<td style="border: 3px solid #3071a9;padding-top: 15px">
      						<input type="file" name="filename" style="padding-left: 600px;position: relative;bottom: 5px" required="required"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">课程价格</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="price"  required="required" style="width: 230px"/>(¥)
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">导师的名字</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="tname"  required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">课程的名称</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="xuename"  required="required"  style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">教材的版本</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="jiaotype"  required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">开课日期</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="stratdate" onclick="WdatePicker()"  required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">结课日期</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="enddate" onclick="WdatePicker()"  required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">导师的评分</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="grade" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">课程的信息</td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="coursetext"></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">课程详情 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="coursecontent"></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">课程安排 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="courseplan"></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">大纲 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="outline" ></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">招生名额 </td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="count" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">教师简介 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="teachermessage"></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">教学经历 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="experience"></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9">
      					<td style="border: 3px solid #3071a9">教学成果 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="result"></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;">
      					<td style="border: 3px solid #3071a9">教学风采 </td>
      					<td style="border: 3px solid #3071a9">
      						<textarea rows="6" cols="36" name="mien"></textarea>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 90px">
      					<td style="border: 3px solid #3071a9">操作 </td>
      					<td style="border: 3px solid #3071a9">
      						<input type="submit" value="入住宜佳佳" class="btn btn-warning"/>
      					</td>
      				</tr>
      			</table>
      			</form>
      		</div>
      		
      		<!-- 用户设置 -->
      		<div style="display: none;" id="setUser">
    			<center><table style="width: 900px;border: 3px solid #3071a9;text-align: center;">
	      			<tr style="border: 3px solid #3071a9;">
	      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">用户编号</td>
	      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">用户头像</td>
	      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">账户名称</td>
	      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">用户密码</td>
	      				<td style="border: 3px solid #3071a9;color: #3071a9;font-size: 1.5em">操作</td>
	      			</tr>
	      			<c:forEach items="${user}" var="i">
	      				<tr style="border: 3px solid #3071a9">
	      					<td style="border: 3px solid #3071a9">${i.uid}<br/></td>
	      					<td style="border: 3px solid #3071a9;">
	      						<img alt="哎呀,怎么无图片了" src="<%=request.getContextPath() %>/js/yjj_ui3/${i.headimage}" style="width: 180px;height: 120px">
	      					</td>
	      					<td style="border: 3px solid #3071a9">${i.tel}</td>
	      					<td style="border: 3px solid #3071a9">${i.pwd}</td>
	      					<td style="border: 3px solid #3071a9"><button class="btn btn-link" onclick="updateUser(${i.uid})">修改用户资料</button>/<button class="btn btn-link" onclick="deleteUser(${i.uid},'${i.tel}')">踢除</button></td>
	      				</tr>
	      			</c:forEach>
	      			<tr>
	      				<td colspan="11">
	      					<button class="btn btn-info" onclick="fenUser(1)">首页</button>&nbsp;&nbsp;&nbsp;
      						<button class="btn btn-warning" onclick="fenUser(${p.uppage})">上一页</button>&nbsp;&nbsp;&nbsp;
      						当前页:${p.countpage}/${p.lastpage}&nbsp;&nbsp;&nbsp;
      						<button class="btn btn-danger" onclick="fenUser(${p.nextpage})">下一页</button>&nbsp;&nbsp;&nbsp;
      						<button class="btn btn-success" onclick="fenUser(${p.lastpage})">末页</button>
	      				</td>
	      			</tr>
      			</table></center>
      			</div>
      			
      			
      			<!-- 修改一个用户的信息 -->
      		<div style="display: none;text-align: center;text-align: center;padding-left: 90px;padding-top: 15px" id="updateUser">
      			<form action="doupdateUser" method="post" enctype="multipart/form-data">
      			<table style="text-align: center;border: 3px solid #3071a9">
      				<tr style="border: 3px solid #3071a9;">
      					<td style="border: 3px solid #3071a9;width: 130px">用户头像</td>
      					<td style="border: 3px solid #3071a9;padding-top: 15px">
      						<img alt="哎呀,竟然没有图片了" src="<%=request.getContextPath() %>/js/yjj_ui3/${OneUser.headimage}" style="width: 180px;height: 120px">
      						<input type="hidden" value="${OneUser.uid}" name="uid"/>
      						<input type="file" name="filename" style="padding-left: 600px;position: relative;bottom: 25px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">账户名称</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="tel" value="${OneUser.tel}" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">用户密码</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="pwd"  value="${OneUser.pwd}" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">操作</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="submit" value="保存" class="btn btn-info"/>
      					</td>
      				</tr>
      			</table>
      			</form>
      		</div>
      		
      		<!-- 新增用户 -->
      		<div style="display: none;text-align: center;text-align: center;padding-left: 90px;padding-top: 15px" id="addUser">
      			<form action="doaddUser" method="post" enctype="multipart/form-data">
      			<table style="text-align: center;border: 3px solid #3071a9">
      				<tr style="border: 3px solid #3071a9;">
      					<td style="border: 3px solid #3071a9;width: 130px">用户头像</td>
      					<td style="border: 3px solid #3071a9;padding-top: 15px">
      						<input type="file" name="filename" style="padding-left: 600px;position: relative;bottom: 5px" required="required"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">账户名称</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="tel" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">用户密码</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="text" name="pwd" required="required" style="width: 230px"/>
      					</td>
      				</tr>
      				<tr style="border: 3px solid #3071a9;height: 60px">
      					<td style="border: 3px solid #3071a9">操作</td>
      					<td style="border: 3px solid #3071a9">
      						<input type="submit" value="新增用户" class="btn btn-danger"/>
      					</td>
      				</tr>
      			</table>
      			</form>
      		</div>
      		
      		
    </div>   
</div>
</center>
</body>
</html>